﻿using System;
using System.Collections.Generic;
using Model.AuthModel;
namespace IDAL.AuthModel
{
    /// <summary>
    /// 通用组件，权限模型，接口层，模块
    /// </summary>
    public interface IModule
    {
        /// <summary>
        /// 新增模块
        /// </summary>
        /// <param name="info">模块对象</param>
        /// <returns>返回保存后的id</returns>
        int InsertModule(ModuleInfo info, out string message);

        /// <summary>
        /// 更新模块
        /// </summary>
        /// <param name="info">模块对象</param>
        /// <returns></returns>
        bool UpdateModule(ModuleInfo info, out string message);

        /// <summary>
        /// 根据编号删除模块
        /// </summary>
        /// <param name="id">模块编号</param>
        /// <returns>删除结果</returns>
        bool DeleteModule(int id);

        /// <summary>
        /// 根据模块编号获取模块对象
        /// </summary>
        /// <param name="id">模块编号</param>
        /// <returns>模块对象</returns>
        ModuleInfo GetModuleByID(int id);

        /// <summary>
        /// 根据条件查询模块的列表
        /// </summary>
        /// <param name="condition">查询条件</param>
        /// <param name="recordcount">返回记录总数</param>
        /// <returns>返回模块列表</returns>
        IList<ModuleInfo> ListModule(ModuleCondition condition, out int recordcount);
    }
}
